package behaviorType.memento;

public class Originator {
    private String userName;
    private int age;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Memento createMemento() {
        return new Memento(this.userName, this.age);
    }

    public void restoreMemento(Memento memento) {
        this.setUserName(memento.getUserName());
        this.setAge(memento.getAge());
    }
}